Change the method used to reverse arrays on unstrip of nowiki and html.
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 28 May 2006 09:07:42 +0000 (09:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 28 May 2006 09:07:42 +0000 (09:07 +0000)
Did similar for other unstrip a while ago because it started mysteriously
blowing up; now getting mysteriuos blowups on these too, not sure why.
Only seems ot be affecting zhwiki for some reason

includes/Parser.php

index 6e335c2..17ffdd4 100644 (file)
@@ -587,14 +587,14 @@ class Parser
                }
 
                # Must expand in reverse order, otherwise nested tags will be corrupted
-               for ( $content = end($state['nowiki']); $content !== false; $content = prev( $state['nowiki'] ) ) {
-                       $text = str_replace( key( $state['nowiki'] ), $content, $text );
+               foreach( array_reverse( $state['nowiki'], true ) as $uniq => $content ) {
+                       $text = str_replace( $uniq, $content, $text );
                }
 
                global $wgRawHtml;
                if ($wgRawHtml) {
-                       for ( $content = end($state['html']); $content !== false; $content = prev( $state['html'] ) ) {
-                               $text = str_replace( key( $state['html'] ), $content, $text );
+                       foreach( array_reverse( $state['html'], true ) as $uniq => $content ) {
+                               $text = str_replace( $uniq, $content, $text );
                        }
                }